package com.common.matcher;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.HttpHeaders;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.StringUtils;

/**
 * @Description: 系统默认的身份验证：校验请求头里是否包含Access-Token值
 * @Date: 2025/6/6 10:34
 */
public class SystemDefaultAuthenticationRequestMatcher implements RequestMatcher {

    @Override
    public boolean matches(HttpServletRequest request) {
        String accessToken = request.getHeader(HttpHeaders.AUTHORIZATION);
        return StringUtils.hasText(accessToken);
    }
}
